<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>后盾招聘企业招聘-教学项目</title>
	<link rel="stylesheet" type="text/css" href="__STATIC__/Css/category-search.css">
	<hdjs/>
	<script type="text/javascript" src="__STATIC__/Js/ajax_pos.js"></script>
	<script type="text/javascript" src="__STATIC__/Js/ajax_city.js"></script>
	<script type="text/javascript" src="__STATIC__/Js/category-search.js"></script>
	<script type="text/javascript" src="__STATIC__/Js/backTop.js"></script>
	<!-- <script type="text/javascript" src="__STATIC__/Js/pos-show.js"></script> -->
<script type="text/javascript">
	var uid = "{$hd.session.uid}";
	var rid = "{$hd.session.rid}"
	$(function(){
		$('.apply').click(function() {
			//如果没有登录则弹出快速登录窗口
			if(!uid){
				show_div($('.login_bg'),$('.quickLogin_box'),10);
				return false;
			}
			//企业会员不能申请职位
			if(rid != 1){
				show_div($('.people_apply_bg'),$('.people_apply_box'),90);
				return false;
			}
			// posname cpid company_uid
			var posname = $(this).attr('posname');
			var cpid = $(this).attr('cpid');
			var company_uid = $(this).attr('company_uid');


			
			var html = '<li>\
							<label for="" class="need_apply">\
								<input type="checkbox" checked="checked" name="position_cpid" value="' + cpid + '" class="position_input">\
								<span class="company_name_span">' + posname + '</span>\
							</label>\
						</li>';
			

			//异步检测当前用户是否可以申请职位
			$.ajax({
				url : CONTROL + '&m=ajax_check_resume',
				dataType : 'json',
				type : 'get',
				success:function(data){
					//如果可以申请，则弹出信息框
					if(data == 1){
						$('.want_invite').html(html);
						//给隐藏域设置内容,设置公司uid
						$('input[name=company_uid]').val(company_uid);
						// 弹出信息框
						show_div($('.loginCom_bg'),$('.loginCom_box'));
					}else{
						show_div($('.people_applyerror_bg'),$('.people_applyerror_box'),10);
					}
				}
			})


			
		});

		$('form[name=apply_form_submit]').submit(function() {
			var f = false;
			$('input[name=resume1_reid]').each(function() {
				if($(this).attr('checked') == 'checked'){
					f = true;
				}
			});

			if(!f){
				alert('请选择简历');
				return false;
			}

			if(!$('input[name=position_cpid]').attr('checked')){
				alert('请选择职位');
				return false;
			}

			var data = $(this).serialize();
			$.ajax({
				url : CONTROL + '&m=ajax_add_apply',
				type : 'post',
				dataType : 'json',
				data : data,
				success:function(data){
					data = parseInt(data);
				 // * 0 申请失败
			  //    * 1 申请成功
			  //    * 2 申请重复
			  //    * 3 申请职位一天不能超过10个
			  		$('.loginCom_bg,.loginCom_box,BG').hide();
					if(data == 0){
						alert('申请失败');
						return false;
					}
			  		
					switch(data){
						case 1:
							show_div($('.apply_success_bg'),$('.apply_success_box'));
							break;
						case 2:
							show_div($('.people_applyerror_bg'),$('.people_applyerror_box'));
							break;
						case 3:
							alert('一天不能申请超过10个职位');
							break;
					}
				}
			})

		});
		
	})

</script>
<include file='__STATIC__/head.html'/>
<include file='__STATIC__/topmenu.html'/>
<!-- 职位搜索盒子开始 -->
	<div class="job_search">
		<div class="top_tit">
			<div class="left">职位搜索</div>
			<div class="right">
				<a href="">网站首页</a>
				<a href="">发布职位</a>
				<a href="">填写简历</a>
			</div>
		</div>
		<form action="" method="get">
			<div class="tit">
				工作地区：
				<div class="item">
					<select name="city_one"  class="select_box_little" >
						<option value="0">请选择</option>
						<foreach from='$topCity' key='$k' value='$v'>
						<if value="$k eq $_GET['city_one']">
							<option value="{$k}" selected="selected">{$v}</option>
						<else/>
							<option value="{$k}">{$v}</option>
						</if>
						</foreach>
					</select>
					<select name="city_second">
						<option value="0">请选择</option>
						<foreach from='$sonCity' key='$k' value='$v'>
						<if value="$k eq $_GET['city_second']">
							<option value="{$k}" selected="selected">{$v}</option>
						<else/>
							<option value="{$k}">{$v}</option>
						</if>
						</foreach>
					</select>
				</div>
			</div>

			<div class="tit two">
				职位类别：&nbsp;
				<div class="item">
					<select class="sel_little" name="pos_one">
						<option value="0">请选择</option>
						<foreach from='$topPos' key='$k' value='$v'>
						<if value="$k eq $_GET['pos_one']">
							<option value="{$k}" selected="selected">{$v}</option>
						<else/>
							<option value="{$k}">{$v}</option>
						</if>
						</foreach>
					</select>
					<select class="sel_little" name="pos_second">
						<option value="0">请选择</option>
						<foreach from='$sonPos' key='$k' value='$v'>
						<if value="$k eq $_GET['pos_second']">
							<option value="{$k}" selected="selected">{$v}</option>
						<else/>
							<option value="{$k}">{$v}</option>
						</if>
						</foreach>
					</select>
				</div>
			</div>
			<div class="four">
				关键字：
				<div class="key">
					<input type="text" class="keyinput" value='{$hd.get.keyword}' name="keyword"/>
					<div class="radio">
						<label>

							<input type="radio" name="type" value="1" <if value='$_GET["type"] eq 1'>checked='checked'</if>/>
							职位
						</label>
						<label>
							<input type="radio" name="type" value="2" <if value='$_GET["type"] eq 2'>checked='checked'</if>/>
							公司
						</label>
						<label>
							<input type="radio" name="type" value="3" <if value='$_GET["type"] eq 3'>checked='checked'</if>/>
							全文
						</label>
					</div>
				</div>
			</div>

			<div class="item_nature">
				<label for="">
					<input type="checkbox" name="quality[]" value="1"  <if value='in_array(1,$_GET["quality"])'>checked='checked'</if>/>
					全职
				</label>
				<label for="">
					<input type="checkbox" name="quality[]" value="2"  <if value='in_array(2,$_GET["quality"])'>checked='checked'</if>/>
					兼职
				</label>
				<label for="">
					<input type="checkbox" name="quality[]" value="3"  <if value='in_array(3,$_GET["quality"])'>checked='checked'</if>/>
					实习
				</label>
			</div>
			<div class="submit">
				<input type="submit" class="now" value="">
			</div>
	</div>
	<!-- 职位搜索盒子结束 -->
	</form>
		<!-- 更多条件隐藏盒子结束 -->
	<!-- 搜索列表盒子开始 -->
	<div class="job_list">
		<form action="" method="get">
		<foreach from='$data' key='$key' value='$value'>
				<div class="list link">
					<a href="" class="name" target="_blank">{$value.positionname}</a>
					<div class="com">
						<a href="" target="_blank">{$value.companyname}</a>
						<img src="__STATIC__/images/79.gif">
						<if value='$value["weekrest"] eq 0'>
							<img src="__STATIC__/images/80.gif">
							<img src="__STATIC__/images/81.gif">
						<elseif value='$value["weekrest"] eq 1'>
							<img src="__STATIC__/images/80.gif">
						<else/>
							<img src="__STATIC__/images/81.gif">
						</if>
						<if value='$value["insure"] eq 0'>
							<img src="__STATIC__/images/82.gif">
							<img src="__STATIC__/images/83.gif">
						<elseif value='$value["insure"] eq 1'>
							<img src="__STATIC__/images/82.gif">
						<else/>
							<img src="__STATIC__/images/83.gif">
						</if>
					</div>
					<p class="price">{$value.salary}</p>
					<span class="day">{$value.endtime}</span>
					<div class="txt">
						<p class="adds">
							工作地点：{$value.cityname}    学历要求：{$value.edu}  | 性别要求：{$value.sex}  | 招聘人数：{$value.invitenum}人
						</p>
						<p class="striking">
							{$value.description|hd_substr:30,'...'}
						</p>
					</div>
					<div class="sub_right">
						<!-- 申请职位按钮 -->
						<a href="javascript:" class="apply" posname="{$value.positionname}" cpid="{$value.cpid}" company_uid="{$value.cbid}"><img src="__STATIC__/images/53.gif"></a>
					</div>
				</div>
		</foreach>
				<!-- <div class="no_content">
					<p class="orange">抱歉，没有符合该搜索条件的职位。</p>
					<ul>
						<li>您可以：</li>
						<li>重新修改搜索条件后再进行搜索。</li>
						<li>适当减少一些搜索条件，以便能够获得更多的结果。</li>
					</ul>
				</div> -->

			<div class="tit">
			</div>
		</form>
	</div>
	<!-- 搜索列表盒子结束 -->

	<div class="page">
		<div class="page_box">
		<!-- <span class="close">上一页</span>
		<strong class="selfpage">1</strong>
		<span class="close">下一页</span>
		<span class="count">[共1页] [2条记录]</span> -->
			{$page}
		</div>
	</div>

<include file='__STATIC__/foot.html'/>
</body>
</html>

<!-- 返回顶部开始 -->
<div class="backtop_box">
	<a href="javascript:vido(0)" class="backtop"></a>
</div>
<!-- 返回顶部结束 -->

<include file="__TPL__/Common/apply_alert.html"/>